<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for CssEventTests.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">Tests<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                                                    
                      		[ <a href="../classtrees_Tests.html" class="menu">class tree: Tests</a> ]
		[ <a href="../elementindex_Tests.html" class="menu">index: Tests</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">Tests</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file CssEventTests.php</h1>
<p>Documentation is available at <a href="../Tests/_test---CssEventTests.php.html">CssEventTests.php</a></p>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;Tests</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a5"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-inc">require_once&nbsp;</span><span class="src-str">'PHPUnit/Framework.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-inc">require_once&nbsp;</span><span class="src-str">'../src/QueryPath/CssEventHandler.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a8"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;Tests&nbsp;for&nbsp;QueryPathCssEventHandler&nbsp;class.</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-key">class&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html">QueryPathCssEventHandlerTests</a>&nbsp;<span class="src-key">extends&nbsp;</span><span class="src-id">PHPUnit_Framework_TestCase&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a13"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a14"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a15"></a>&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#var$xml">$xml</a>&nbsp;=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-str">&nbsp;&nbsp;&lt;html&gt;</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-str">&nbsp;&nbsp;&lt;head&gt;</span></div></li>
<li><div class="src-line"><a name="a18"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;title&gt;This&nbsp;is&nbsp;the&nbsp;title&lt;/title&gt;</span></div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-str">&nbsp;&nbsp;&lt;/head&gt;</span></div></li>
<li><div class="src-line"><a name="a20"></a><span class="src-str">&nbsp;&nbsp;&lt;body&gt;</span></div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id=&quot;one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id=&quot;two&quot;&nbsp;class=&quot;class-one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id=&quot;three&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Inner&nbsp;text.</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;class=&quot;class-two&quot;&gt;Nada&lt;/span&gt;</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&gt;&lt;p&gt;&lt;p&gt;&lt;p&gt;&lt;p&gt;&lt;p&gt;&lt;p&nbsp;class=&quot;Odd&quot;&gt;&lt;p&gt;8&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;&lt;/p&gt;</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;Odd&quot;&nbsp;id=&quot;li-one&quot;&gt;Odd&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;even&quot;&nbsp;id=&quot;li-two&quot;&gt;Even&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a33"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;Odd&quot;&nbsp;id=&quot;li-three&quot;&gt;Odd&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a34"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;even&quot;&nbsp;id=&quot;li-four&quot;&gt;Even&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a35"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;Odd&quot;&nbsp;id=&quot;li-five&quot;&gt;Odd&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a36"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;even&quot;&nbsp;id=&quot;li-six&quot;&gt;Even&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a37"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;Odd&quot;&nbsp;id=&quot;li-seven&quot;&gt;Odd&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a38"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;even&quot;&nbsp;id=&quot;li-eight&quot;&gt;Even&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a39"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;Odd&quot;&nbsp;id=&quot;li-nine&quot;&gt;Odd&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a40"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&quot;even&quot;&nbsp;id=&quot;li-ten&quot;&gt;Even&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a41"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;</span></div></li>
<li><div class="src-line"><a name="a42"></a><span class="src-str">&nbsp;&nbsp;&lt;/body&gt;</span></div></li>
<li><div class="src-line"><a name="a43"></a><span class="src-str">&nbsp;&nbsp;&lt;/html&gt;</span></div></li>
<li><div class="src-line"><a name="a44"></a><span class="src-str">&nbsp;&nbsp;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a45"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a46"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestGetMatches">testGetMatches</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a47"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;root&nbsp;element:</span></div></li>
<li><div class="src-line"><a name="a48"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a49"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a50"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a51"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a52"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;handing&nbsp;it&nbsp;a&nbsp;DOM&nbsp;Document</span></div></li>
<li><div class="src-line"><a name="a53"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a54"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a55"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertTrue</span><span class="src-sym">(</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">)&nbsp;</span>==&nbsp;<span class="src-num">1</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a56"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a57"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'test'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a58"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a59"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;handling&nbsp;single&nbsp;element</span></div></li>
<li><div class="src-line"><a name="a60"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$root&nbsp;</span>=&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">documentElement</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a61"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$root</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a62"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a63"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a64"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a65"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'test'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a66"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a67"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;handling&nbsp;a&nbsp;node&nbsp;list</span></div></li>
<li><div class="src-line"><a name="a68"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$eles&nbsp;</span>=&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">getElementsByTagName</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a69"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$eles</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a70"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a71"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a72"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a73"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a74"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a75"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;handling&nbsp;an&nbsp;array&nbsp;of&nbsp;elements</span></div></li>
<li><div class="src-line"><a name="a76"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$eles&nbsp;</span>=&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">getElementsByTagName</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a77"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$array&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a78"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$eles&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$ele</span><span class="src-sym">)&nbsp;</span><span class="src-var">$array</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$ele</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a79"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$array</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a80"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a81"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a82"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a83"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a84"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a85"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a86"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestElement">testElement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a87"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;id=&quot;first&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a88"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a89"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a90"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a91"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Basic&nbsp;test</span></div></li>
<li><div class="src-line"><a name="a92"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a93"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a94"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a95"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a96"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a97"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a98"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a99"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a100"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#var$xml">xml</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a101"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a102"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;getting&nbsp;nested</span></div></li>
<li><div class="src-line"><a name="a103"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a104"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'div'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a105"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a106"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a107"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a108"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'div'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a109"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a110"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a111"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;getting&nbsp;a&nbsp;list</span></div></li>
<li><div class="src-line"><a name="a112"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a113"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'li'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a114"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a115"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">10</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a116"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a117"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$this-&gt;assertEquals('div',&nbsp;$match-&gt;tagName);</span></div></li>
<li><div class="src-line"><a name="a118"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'li-one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a119"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a120"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;getting&nbsp;the&nbsp;root&nbsp;element</span></div></li>
<li><div class="src-line"><a name="a121"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a122"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'html'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a123"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a124"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a125"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a126"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'html'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a127"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a128"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a129"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestElementId">testElementId</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a130"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;root&nbsp;element:</span></div></li>
<li><div class="src-line"><a name="a131"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;id=&quot;first&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a132"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a133"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a134"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a135"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a136"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#first'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a137"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a138"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a139"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a140"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a141"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a142"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;a&nbsp;search&nbsp;with&nbsp;restricted&nbsp;scope:</span></div></li>
<li><div class="src-line"><a name="a143"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a144"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside#first'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a145"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a146"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a147"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a148"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a149"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a150"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a151"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a152"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestAnyElement">testAnyElement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a153"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a154"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a155"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a156"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a157"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;handing&nbsp;it&nbsp;a&nbsp;DOM&nbsp;Document</span></div></li>
<li><div class="src-line"><a name="a158"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a159"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'*'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a160"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a161"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a162"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a163"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a164"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'test'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a165"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a166"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a167"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#var$xml">xml</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a168"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a169"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;handing&nbsp;it&nbsp;a&nbsp;DOM&nbsp;Document</span></div></li>
<li><div class="src-line"><a name="a170"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a171"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#two&nbsp;*'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a172"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a173"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a174"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a175"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a176"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a177"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a178"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestElementClass">testElementClass</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a179"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;class=&quot;foo&quot;&nbsp;id=&quot;one&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a180"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a181"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a182"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a183"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;basic&nbsp;class</span></div></li>
<li><div class="src-line"><a name="a184"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a185"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'.foo'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a186"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a187"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a188"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a189"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a190"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a191"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;class&nbsp;in&nbsp;element</span></div></li>
<li><div class="src-line"><a name="a192"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a193"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#var$xml">xml</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a194"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a195"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'li.Odd'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a196"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a197"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">5</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a198"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">4</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a199"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'li-nine'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a200"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a201"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;ID/class&nbsp;combo</span></div></li>
<li><div class="src-line"><a name="a202"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a203"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'.Odd#li-nine'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a204"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a205"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a206"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a207"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'li-nine'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a208"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a209"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a210"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a211"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestDirectDescendant">testDirectDescendant</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a212"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a213"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a214"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;class=&quot;foo&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a215"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Text</span></div></li>
<li><div class="src-line"><a name="a216"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;id=&quot;two&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a217"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;id=&quot;inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a218"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/inside&gt;</span></div></li>
<li><div class="src-line"><a name="a219"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a220"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a221"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a222"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a223"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;direct&nbsp;descendent</span></div></li>
<li><div class="src-line"><a name="a224"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a225"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'test&nbsp;&gt;&nbsp;inside'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a226"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a227"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a228"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a229"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a230"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a231"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a232"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a233"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestAttribute">testAttribute</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a234"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;id=&quot;one&quot;&nbsp;name=&quot;antidisestablishmentarianism&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a235"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a236"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a237"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a238"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;match&nbsp;on&nbsp;attr&nbsp;name</span></div></li>
<li><div class="src-line"><a name="a239"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a240"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a241"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a242"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a243"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a244"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a245"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a246"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;broken&nbsp;form</span></div></li>
<li><div class="src-line"><a name="a247"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a248"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[@name]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a249"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a250"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a251"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a252"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a253"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a254"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;match&nbsp;on&nbsp;attr&nbsp;name&nbsp;and&nbsp;equals&nbsp;value</span></div></li>
<li><div class="src-line"><a name="a255"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a256"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name=&quot;antidisestablishmentarianism&quot;]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a257"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a258"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a259"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a260"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a261"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a262"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;match&nbsp;on&nbsp;containsInString</span></div></li>
<li><div class="src-line"><a name="a263"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a264"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name*=&quot;disestablish&quot;]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a265"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a266"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a267"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a268"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a269"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a270"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;match&nbsp;on&nbsp;beginsWith</span></div></li>
<li><div class="src-line"><a name="a271"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a272"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name^=&quot;anti&quot;]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a273"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a274"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a275"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a276"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a277"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a278"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;match&nbsp;on&nbsp;endsWith</span></div></li>
<li><div class="src-line"><a name="a279"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a280"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name$=&quot;ism&quot;]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a281"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a282"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a283"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a284"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a285"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a286"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;containsWithSpace</span></div></li>
<li><div class="src-line"><a name="a287"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;id=&quot;one&quot;&nbsp;name=&quot;anti&nbsp;dis&nbsp;establishment&nbsp;arian&nbsp;ism&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a288"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a289"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a290"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a291"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a292"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name~=&quot;dis&quot;]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a293"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a294"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a295"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a296"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a297"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a298"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;containsWithHyphen</span></div></li>
<li><div class="src-line"><a name="a299"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;id=&quot;one&quot;&nbsp;name=&quot;en-us&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a300"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a301"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a302"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a303"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a304"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside[name|=&quot;us&quot;]'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a305"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a306"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a307"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a308"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a309"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a310"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a311"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a312"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassLang">testPseudoClassLang</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a313"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a314"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;lang=&quot;en-us&quot;&nbsp;id=&quot;one&quot;/&gt;Text&lt;inside/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a315"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a316"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a317"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a318"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a319"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':lang(en-us)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a320"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a321"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a322"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a323"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a324"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a325"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a326"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside:lang(en)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a327"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a328"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a329"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a330"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a331"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a332"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a333"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside:lang(us)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a334"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a335"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a336"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a337"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a338"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a339"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;&lt;test&gt;&lt;inside&nbsp;lang=&quot;en-us&quot;&nbsp;id=&quot;one&quot;/&gt;Text&lt;inside&nbsp;lang=&quot;us&quot;&nbsp;id=&quot;two&quot;/&gt;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a340"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a341"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a342"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a343"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a344"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':lang(us)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a345"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a346"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a347"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a348"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a349"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a350"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a351"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&nbsp;xmlns=&quot;http://aleph-null.tv/xml&quot;&nbsp;xmlns:xml=&quot;http://www.w3.org/XML/1998/namespace&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a352"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;lang=&quot;en-us&quot;&nbsp;id=&quot;one&quot;/&gt;Text</span></div></li>
<li><div class="src-line"><a name="a353"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;xml:lang=&quot;en-us&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a354"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a355"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a356"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a357"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a358"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a359"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':lang(us)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a360"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a361"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a362"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a363"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a364"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a365"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a366"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassEnabledDisabledChecked">testPseudoClassEnabledDisabledChecked</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a367"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a368"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a369"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;enabled=&quot;enabled&quot;&nbsp;id=&quot;one&quot;/&gt;Text</span></div></li>
<li><div class="src-line"><a name="a370"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;disabled=&quot;disabled&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a371"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;checked=&quot;FOOOOO&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a372"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a373"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a374"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a375"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a376"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a377"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':enabled'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a378"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a379"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a380"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a381"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a382"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a383"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a384"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':disabled'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a385"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a386"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a387"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a388"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a389"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a390"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a391"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':checked()'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a392"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a393"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a394"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$match&nbsp;</span>=&nbsp;<span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a395"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$match</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a396"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a397"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a398"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassXReset">testPseudoClassXReset</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a399"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a400"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a401"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;enabled=&quot;enabled&quot;&nbsp;id=&quot;one&quot;/&gt;Text</span></div></li>
<li><div class="src-line"><a name="a402"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;disabled=&quot;disabled&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a403"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;checked=&quot;FOOOOO&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a404"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a405"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a406"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a407"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a408"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a409"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a410"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a411"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a412"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':x-reset'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a413"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a414"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a415"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'test'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a416"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a417"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a418"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassRoot">testPseudoClassRoot</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a419"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a420"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a421"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;enabled=&quot;enabled&quot;&nbsp;id=&quot;one&quot;/&gt;Text</span></div></li>
<li><div class="src-line"><a name="a422"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;disabled=&quot;disabled&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a423"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inside&nbsp;checked=&quot;FOOOOO&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a424"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a425"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a426"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a427"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$start&nbsp;</span>=&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">getElementsByTagName</span><span class="src-sym">(</span><span class="src-str">'inside'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a428"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a429"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Start&nbsp;&quot;deep&nbsp;in&nbsp;the&nbsp;doc&quot;&nbsp;and&nbsp;traverse&nbsp;backward.</span></div></li>
<li><div class="src-line"><a name="a430"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$start</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a431"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':root'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a432"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a433"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a434"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'test'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">tagName</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a435"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a436"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a437"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;removed&nbsp;so&nbsp;I&nbsp;can&nbsp;re-declare&nbsp;</span></div></li>
<li><div class="src-line"><a name="a438"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;listPeerElemens&nbsp;as&nbsp;private.</span></div></li>
<li><div class="src-line"><a name="a439"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodxtestListPeerElements">xtestListPeerElements</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a440"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a441"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a442"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a443"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a444"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a445"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a446"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a447"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;e&nbsp;class=&quot;even&quot;&nbsp;id=&quot;six&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a448"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a449"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a450"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a451"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a452"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;full&nbsp;list</span></div></li>
<li><div class="src-line"><a name="a453"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a454"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#one'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a455"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a456"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$peers&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">listPeerElements</span><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a457"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">6</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$peers</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a458"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a459"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a460"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassNthChild">testPseudoClassNthChild</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a461"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a462"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a463"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a464"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a465"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a466"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a467"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a468"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;e&nbsp;class=&quot;even&quot;&nbsp;id=&quot;six&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a469"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a470"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a471"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a472"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a473"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;full&nbsp;list</span></div></li>
<li><div class="src-line"><a name="a474"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a475"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':root&nbsp;:even'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a476"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a477"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a478"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a479"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a480"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;restricted&nbsp;to&nbsp;specific&nbsp;element</span></div></li>
<li><div class="src-line"><a name="a481"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a482"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:even'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a483"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a484"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a485"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a486"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a487"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;restricted&nbsp;to&nbsp;specific&nbsp;element,&nbsp;odd&nbsp;this&nbsp;time</span></div></li>
<li><div class="src-line"><a name="a488"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a489"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:odd'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a490"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a491"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a492"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a493"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a494"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(odd)</span></div></li>
<li><div class="src-line"><a name="a495"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a496"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(odd)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a497"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a498"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a499"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a500"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a501"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(2n+1)</span></div></li>
<li><div class="src-line"><a name="a502"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a503"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(2n+1)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a504"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a505"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a506"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a507"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a508"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(2n)&nbsp;(even)</span></div></li>
<li><div class="src-line"><a name="a509"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a510"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(2n)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a511"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a512"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a513"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a514"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a515"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Not&nbsp;totally&nbsp;sure&nbsp;what&nbsp;should&nbsp;be&nbsp;returned&nbsp;here</span></div></li>
<li><div class="src-line"><a name="a516"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(-2n)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a517"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$handler&nbsp;=&nbsp;new&nbsp;QueryPathCssEventHandler($doc);</span></div></li>
<li><div class="src-line"><a name="a518"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$handler-&gt;find('i:nth-child(-2n)');</span></div></li>
<li><div class="src-line"><a name="a519"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$matches&nbsp;=&nbsp;$handler-&gt;getMatches();</span></div></li>
<li><div class="src-line"><a name="a520"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;assertEquals(2,&nbsp;count($matches));</span></div></li>
<li><div class="src-line"><a name="a521"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;assertEquals('four',&nbsp;$matches[1]-&gt;getAttribute('id'));</span></div></li>
<li><div class="src-line"><a name="a522"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a523"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(2n-1)&nbsp;(odd,&nbsp;equiv&nbsp;to&nbsp;2n&nbsp;+&nbsp;1)</span></div></li>
<li><div class="src-line"><a name="a524"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a525"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(2n-1)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a526"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a527"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a528"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a529"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a530"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(4n)&nbsp;(every&nbsp;fourth&nbsp;row)</span></div></li>
<li><div class="src-line"><a name="a531"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a532"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(4n)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a533"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a534"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a535"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a536"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a537"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(4n+1)&nbsp;(first&nbsp;of&nbsp;every&nbsp;four&nbsp;rows)</span></div></li>
<li><div class="src-line"><a name="a538"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a539"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(4n+1)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a540"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a541"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Should&nbsp;match&nbsp;rows&nbsp;one&nbsp;and&nbsp;five</span></div></li>
<li><div class="src-line"><a name="a542"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a543"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'five'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a544"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a545"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(1)&nbsp;(First&nbsp;row)</span></div></li>
<li><div class="src-line"><a name="a546"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a547"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(1)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a548"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a549"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a550"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a551"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a552"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(0n-0)&nbsp;(Empty&nbsp;list)</span></div></li>
<li><div class="src-line"><a name="a553"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a554"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(0n-0)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a555"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a556"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a557"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a558"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nth-child(-n+3)&nbsp;(First&nbsp;three&nbsp;lines)</span></div></li>
<li><div class="src-line"><a name="a559"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$handler&nbsp;=&nbsp;new&nbsp;QueryPathCssEventHandler($doc);</span></div></li>
<li><div class="src-line"><a name="a560"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$handler-&gt;find('i:nth-child(-n+3)');</span></div></li>
<li><div class="src-line"><a name="a561"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$matches&nbsp;=&nbsp;$handler-&gt;getMatches();</span></div></li>
<li><div class="src-line"><a name="a562"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;$this-&gt;assertEquals(3,&nbsp;count($matches));</span></div></li>
<li><div class="src-line"><a name="a563"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a564"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a565"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a566"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a567"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a568"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a569"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a570"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a571"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a572"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a573"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a574"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;e&nbsp;class=&quot;even&quot;&nbsp;id=&quot;six&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a575"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a576"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a577"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a578"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a579"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;nested&nbsp;items.</span></div></li>
<li><div class="src-line"><a name="a580"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a581"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth-child(odd)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a582"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a583"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">4</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a584"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matchIDs&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a585"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$matches&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$m</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a586"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matchIDs</span><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-var">$m</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a587"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a588"></a><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;$matchIDs&nbsp;=&nbsp;sort($matchIDs);</span></div></li>
<li><div class="src-line"><a name="a589"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'inner-one'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'five'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matchIDs</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a590"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$this-&gt;assertEquals('inner-one',&nbsp;$matches[3]-&gt;getAttribute('id'));</span></div></li>
<li><div class="src-line"><a name="a591"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a592"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a593"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassOnlyChild">testPseudoClassOnlyChild</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a594"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a595"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a596"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a597"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a598"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a599"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a600"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a601"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;single&nbsp;last&nbsp;child.</span></div></li>
<li><div class="src-line"><a name="a602"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a603"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:only-child'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a604"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a605"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a606"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a607"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a608"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a609"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a610"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a611"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a612"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a613"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a614"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a615"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a616"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;single&nbsp;last&nbsp;child.</span></div></li>
<li><div class="src-line"><a name="a617"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a618"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:only-child'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a619"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a620"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">0</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a621"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$this-&gt;assertEquals('one',&nbsp;$matches[0]-&gt;getAttribute('id'));</span></div></li>
<li><div class="src-line"><a name="a622"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a623"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a624"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassFirstChild">testPseudoClassFirstChild</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a625"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a626"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a627"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a628"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a629"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a630"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;four&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a631"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a632"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a633"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a634"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a635"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a636"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a637"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;e&nbsp;class=&quot;even&quot;&nbsp;id=&quot;six&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a638"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a639"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a640"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a641"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a642"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;single&nbsp;last&nbsp;child.</span></div></li>
<li><div class="src-line"><a name="a643"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a644"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#four&nbsp;&gt;&nbsp;i:first-child'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a645"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a646"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a647"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a648"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a649"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;for&nbsp;two&nbsp;last&nbsp;children</span></div></li>
<li><div class="src-line"><a name="a650"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a651"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:first-child'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a652"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a653"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a654"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a655"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a656"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a657"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassLastChild">testPseudoClassLastChild</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a658"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a659"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a660"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a661"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a662"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a663"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;four&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a664"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a665"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a666"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a667"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a668"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a669"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a670"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;e&nbsp;class=&quot;even&quot;&nbsp;id=&quot;six&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a671"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a672"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a673"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a674"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a675"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;single&nbsp;last&nbsp;child.</span></div></li>
<li><div class="src-line"><a name="a676"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a677"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#four&nbsp;&gt;&nbsp;i:last-child'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a678"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a679"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a680"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a681"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a682"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;for&nbsp;two&nbsp;last&nbsp;children</span></div></li>
<li><div class="src-line"><a name="a683"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a684"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:last-child'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a685"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a686"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a687"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a688"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a689"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a690"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassNthLastChild">testPseudoClassNthLastChild</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a691"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a692"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a693"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a694"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a695"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a696"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;four&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a697"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a698"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a699"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;inner-three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a700"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;inner-four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a701"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a702"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a703"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;e&nbsp;class=&quot;even&quot;&nbsp;id=&quot;six&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a704"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a705"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a706"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a707"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a708"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;alternate&nbsp;rows&nbsp;from&nbsp;the&nbsp;end.</span></div></li>
<li><div class="src-line"><a name="a709"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a710"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#four&nbsp;&gt;&nbsp;i:nth-last-child(odd)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a711"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a712"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a713"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a714"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a715"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a716"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;According&nbsp;to&nbsp;spec,&nbsp;this&nbsp;should&nbsp;be&nbsp;last&nbsp;two&nbsp;elements.</span></div></li>
<li><div class="src-line"><a name="a717"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a718"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#four&nbsp;&gt;&nbsp;i:nth-last-child(-1n+2)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a719"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a720"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//print&nbsp;$matches[0]-&gt;getAttribute('id');</span></div></li>
<li><div class="src-line"><a name="a721"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a722"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-four'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a723"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a724"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a725"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a726"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassFirstOfType">testPseudoClassFirstOfType</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a727"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a728"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a729"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;n&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a730"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a731"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a732"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a733"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a734"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a735"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a736"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;alternate&nbsp;rows&nbsp;from&nbsp;the&nbsp;end.</span></div></li>
<li><div class="src-line"><a name="a737"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a738"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:first-of-type(odd)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a739"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a740"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a741"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a742"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a743"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a744"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassEmpty">testPseudoClassEmpty</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a745"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a746"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a747"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;n&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a748"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;&gt;&lt;/i&gt;</span></div></li>
<li><div class="src-line"><a name="a749"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a750"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a751"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a752"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a753"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a754"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'n:empty'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a755"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a756"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a757"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a758"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a759"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a760"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:empty'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a761"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a762"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a763"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a764"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a765"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a766"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassFirst">testPseudoClassFirst</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a767"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a768"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a769"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a770"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a771"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a772"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a773"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a774"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a775"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a776"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;alternate&nbsp;rows&nbsp;from&nbsp;the&nbsp;end.</span></div></li>
<li><div class="src-line"><a name="a777"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a778"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:first'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a779"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a780"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a781"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a782"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a783"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a784"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassLast">testPseudoClassLast</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a785"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a786"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a787"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a788"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a789"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a790"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a791"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a792"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a793"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a794"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;alternate&nbsp;rows&nbsp;from&nbsp;the&nbsp;end.</span></div></li>
<li><div class="src-line"><a name="a795"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a796"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:last'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a797"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a798"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a799"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a800"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a801"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a802"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassGT">testPseudoClassGT</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a803"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a804"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a805"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a806"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a807"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a808"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a809"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a810"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a811"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a812"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;alternate&nbsp;rows&nbsp;from&nbsp;the&nbsp;end.</span></div></li>
<li><div class="src-line"><a name="a813"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a814"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:gt(1)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a815"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a816"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a817"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a818"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a819"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassLT">testPseudoClassLT</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a820"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a821"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a822"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a823"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a824"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a825"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a826"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a827"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a828"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a829"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;alternate&nbsp;rows&nbsp;from&nbsp;the&nbsp;end.</span></div></li>
<li><div class="src-line"><a name="a830"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a831"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:lt(3)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a832"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a833"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a834"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a835"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a836"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassNTH">testPseudoClassNTH</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a837"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a838"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a839"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a840"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a841"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;i&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a842"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a843"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a844"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a845"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a846"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a847"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:nth(2)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a848"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a849"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a850"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a851"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a852"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a853"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'i:eq(2)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a854"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a855"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a856"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a857"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a858"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a859"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassFormElements">testPseudoClassFormElements</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a860"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$form&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'text'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'radio'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'checkbox'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'button'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'password'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a861"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a862"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a863"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;input&nbsp;type=&quot;%s&quot;&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a864"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a865"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a866"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$form&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$item</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a867"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a868"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><a href="http://www.php.net/sprintf">sprintf</a><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">,&nbsp;</span><span class="src-var">$item</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a869"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a870"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a871"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':'&nbsp;</span>.&nbsp;<span class="src-var">$item</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a872"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a873"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a874"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a875"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a876"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a877"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a878"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassHeader">testPseudoClassHeader</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a879"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a880"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a881"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h1&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a882"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h2&nbsp;class=&quot;even&quot;&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a883"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;h6&nbsp;class=&quot;odd&quot;&nbsp;id=&quot;three&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a884"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a885"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a886"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a887"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a888"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a889"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'test&nbsp;:header'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a890"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a891"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">3</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a892"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a893"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a894"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a895"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassContains">testPseudoClassContains</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a896"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a897"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a898"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&nbsp;id=&quot;one&quot;&gt;This&nbsp;is&nbsp;text.&lt;/p&gt;</span></div></li>
<li><div class="src-line"><a name="a899"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&nbsp;id=&quot;two&quot;&gt;&lt;i&gt;More&nbsp;text&lt;/i&gt;&lt;/p&gt;</span></div></li>
<li><div class="src-line"><a name="a900"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a901"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a902"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a903"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a904"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a905"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">':contains(This&nbsp;is&nbsp;text.)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a906"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a907"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a908"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a909"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a910"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a911"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'*&nbsp;:contains(More&nbsp;text)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a912"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a913"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a914"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a915"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a916"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a917"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassHas">testPseudoClassHas</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a918"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a919"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a920"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;outer&nbsp;id=&quot;one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a921"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inner/&gt;</span></div></li>
<li><div class="src-line"><a name="a922"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/outer&gt;</span></div></li>
<li><div class="src-line"><a name="a923"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;outer&nbsp;id=&quot;two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a924"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a925"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a926"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a927"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a928"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a929"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'outer:has(inner)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a930"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a931"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a932"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a933"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a934"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a935"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoClassNot">testPseudoClassNot</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a936"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a937"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a938"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;outer&nbsp;id=&quot;one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a939"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;inner/&gt;</span></div></li>
<li><div class="src-line"><a name="a940"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/outer&gt;</span></div></li>
<li><div class="src-line"><a name="a941"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;outer&nbsp;id=&quot;two&quot;&nbsp;class=&quot;notMe&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a942"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a943"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a944"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a945"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a946"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a947"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'outer:not(#one)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a948"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a949"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a950"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a951"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a952"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a953"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'outer:not(inner)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a954"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a955"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a956"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a957"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a958"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a959"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'outer:not(.notMe)'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a960"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a961"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a962"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a963"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a964"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a965"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestPseudoElement">testPseudoElement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a966"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a967"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a968"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;outer&nbsp;id=&quot;one&quot;&gt;Text</span></div></li>
<li><div class="src-line"><a name="a969"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a970"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;More&nbsp;text&lt;/outer&gt;</span></div></li>
<li><div class="src-line"><a name="a971"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;outer&nbsp;id=&quot;two&quot;&nbsp;class=&quot;notMe&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a972"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a973"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a974"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a975"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a976"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a977"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'outer::first-letter'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a978"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a979"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a980"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'T'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a981"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a982"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a983"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'outer::first-line'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a984"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a985"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a986"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'Text'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a987"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a988"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a989"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestAdjacent">testAdjacent</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a990"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a991"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a992"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;one&quot;/&gt;&lt;li&nbsp;id=&quot;two&quot;/&gt;&lt;li&nbsp;id=&quot;three&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a993"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a994"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a995"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a996"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a997"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a998"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a999"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1000"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1001"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1002"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1003"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1004"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1005"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1006"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#one&nbsp;+&nbsp;li'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1007"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1008"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1009"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1010"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1011"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Tell&nbsp;it&nbsp;to&nbsp;ignore&nbsp;whitespace&nbsp;nodes.</span></div></li>
<li><div class="src-line"><a name="a1012"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">,&nbsp;</span><span class="src-id">LIBXML_NOBLANKS</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1013"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1014"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;with&nbsp;whitespace&nbsp;sensitivity&nbsp;weakened.</span></div></li>
<li><div class="src-line"><a name="a1015"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1016"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#four&nbsp;+&nbsp;li'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1017"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1018"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1019"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'five'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1020"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1021"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestAnotherSelector">testAnotherSelector</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1022"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a1023"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a1024"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;one&quot;/&gt;&lt;li&nbsp;id=&quot;two&quot;/&gt;&lt;li&nbsp;id=&quot;three&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a1025"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a1026"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1027"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1028"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a1029"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1030"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a1031"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1032"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1033"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1034"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1035"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1036"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1037"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1038"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#one,&nbsp;#two'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1039"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1040"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//print&nbsp;$matches[0]-&gt;getAttribute('id')&nbsp;.&nbsp;PHP_EOL;</span></div></li>
<li><div class="src-line"><a name="a1041"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1042"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1043"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1044"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1045"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestSibling">testSibling</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1046"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a1047"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a1048"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;one&quot;/&gt;&lt;li&nbsp;id=&quot;two&quot;/&gt;&lt;li&nbsp;id=&quot;three&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a1049"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-one&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a1050"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-inner-one&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1051"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;il&nbsp;id=&quot;inner-inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1052"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;dont-match-me&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1053"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a1054"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1055"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a1056"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1057"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1058"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1059"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1060"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1061"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1062"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1063"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#one&nbsp;~&nbsp;li'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1064"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1065"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//print&nbsp;$matches[0]-&gt;getAttribute('id')&nbsp;.&nbsp;PHP_EOL;</span></div></li>
<li><div class="src-line"><a name="a1066"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">4</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1067"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'three'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1068"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1069"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1070"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#inner-one&nbsp;&gt;&nbsp;li&nbsp;~&nbsp;il'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1071"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1072"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//print&nbsp;$matches[0]-&gt;getAttribute('id')&nbsp;.&nbsp;PHP_EOL;</span></div></li>
<li><div class="src-line"><a name="a1073"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">1</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1074"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-inner-two'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1075"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1076"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1077"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/QueryPathCssEventHandlerTests.html#methodtestAnyDescendant">testAnyDescendant</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1078"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$xml&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;&nbsp;?&gt;</span></div></li>
<li><div class="src-line"><a name="a1079"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;test&gt;</span></div></li>
<li><div class="src-line"><a name="a1080"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;one&quot;/&gt;&lt;li&nbsp;id=&quot;two&quot;/&gt;&lt;li&nbsp;id=&quot;three&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a1081"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-one&quot;&nbsp;class=&quot;foo&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a1082"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-inner-one&quot;&nbsp;class=&quot;foo&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1083"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;il&nbsp;id=&quot;inner-inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1084"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;dont-match-me&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1085"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a1086"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;inner-two&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1087"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/li&gt;</span></div></li>
<li><div class="src-line"><a name="a1088"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;four&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1089"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;id=&quot;five&quot;/&gt;</span></div></li>
<li><div class="src-line"><a name="a1090"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/test&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1091"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">DomDocument</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1092"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$doc</span><span class="src-sym">-&gt;</span><span class="src-id">loadXML</span><span class="src-sym">(</span><span class="src-var">$xml</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1093"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1094"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1095"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'*'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1096"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1097"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">11</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1098"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1099"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1100"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'*.foo'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1101"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1102"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1103"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-inner-one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1104"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1105"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/QueryPathCssEventHandler.html">QueryPathCssEventHandler</a></span><span class="src-sym">(</span><span class="src-var">$doc</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1106"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'test&nbsp;&gt;&nbsp;li&nbsp;*.foo'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1107"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$matches&nbsp;</span>=&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">getMatches</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1108"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-num">2</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/count">count</a><span class="src-sym">(</span><span class="src-var">$matches</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1109"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertEquals</span><span class="src-sym">(</span><span class="src-str">'inner-inner-one'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$matches</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">-&gt;</span><span class="src-id">getAttribute</span><span class="src-sym">(</span><span class="src-str">'id'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1110"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1111"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1112"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1113"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1114"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1115"></a><span class="src-key">class&nbsp;</span><a href="../Tests/CssEventParserTests.html">CssEventParserTests</a>&nbsp;<span class="src-key">extends&nbsp;</span><span class="src-id">PHPUnit_Framework_TestCase&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1116"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1117"></a>&nbsp;&nbsp;<span class="src-key">private&nbsp;</span><span class="src-key">function&nbsp;</span><span class="src-id">getMockHandler</span><span class="src-sym">(</span><span class="src-var">$method</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1118"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-var">$method</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1119"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1120"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-var">$method</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1121"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mytest'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1122"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1123"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1124"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1125"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestElementID">testElementID</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1126"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMockHandler</span><span class="src-sym">(</span><span class="src-str">'elementID'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1127"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'#mytest'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1128"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1129"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1130"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1131"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1132"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestElement">testElement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1133"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1134"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Without&nbsp;namespace</span></div></li>
<li><div class="src-line"><a name="a1135"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMockHandler</span><span class="src-sym">(</span><span class="src-str">'element'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1136"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'mytest'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1137"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1138"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1139"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;With&nbsp;empty&nbsp;namespace</span></div></li>
<li><div class="src-line"><a name="a1140"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMockHandler</span><span class="src-sym">(</span><span class="src-str">'element'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1141"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'|mytest'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1142"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1143"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1144"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1145"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestElementNS">testElementNS</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1146"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'elementNS'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1147"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1148"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'elementNS'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1149"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mytest'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'myns'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1150"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1151"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'myns|mytest'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1152"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1153"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1154"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'elementNS'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1155"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1156"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'elementNS'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1157"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mytest'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'*'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1158"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1159"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'*|mytest'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1160"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1161"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1162"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1163"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAnyElement">testAnyElement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1164"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'anyElement'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'element'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1165"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1166"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'anyElement'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1167"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1168"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'*'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1169"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1170"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1171"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1172"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAnyElementInNS">testAnyElementInNS</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1173"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'anyElementInNS'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'element'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1174"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1175"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'anyElementInNS'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1176"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'myns'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1177"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1178"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'myns|*'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1179"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1180"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1181"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1182"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestElementClass">testElementClass</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1183"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'elementClass'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1184"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1185"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'elementClass'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1186"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'myclass'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1187"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1188"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'.myclass'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1189"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1190"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1191"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1192"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestPseudoClass">testPseudoClass</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1193"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1194"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;empty&nbsp;pseudoclass</span></div></li>
<li><div class="src-line"><a name="a1195"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pseudoClass'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1196"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1197"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'pseudoClass'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1198"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mypclass'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1199"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1200"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'myele:mypclass'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1201"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1202"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1203"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;pseudoclass&nbsp;with&nbsp;value</span></div></li>
<li><div class="src-line"><a name="a1204"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pseudoClass'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1205"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1206"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'pseudoClass'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1207"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mypclass'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'myval'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1208"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1209"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'myele:mypclass(myval)'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1210"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1211"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1212"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;pseudclass&nbsp;with&nbsp;pseudoclass:</span></div></li>
<li><div class="src-line"><a name="a1213"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pseudoClass'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1214"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1215"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'pseudoClass'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1216"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mypclass'</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">':anotherPseudo'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1217"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1218"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'myele:mypclass(:anotherPseudo)'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1219"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1220"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1221"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1222"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1223"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestPseudoElement">testPseudoElement</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1224"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;pseudo-element</span></div></li>
<li><div class="src-line"><a name="a1225"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pseudoElement'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1226"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1227"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'pseudoElement'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1228"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-str">'mypele'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1229"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1230"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'myele::mypele'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1231"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1232"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1233"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1234"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestDirectDescendant">testDirectDescendant</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1235"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;direct&nbsp;Descendant</span></div></li>
<li><div class="src-line"><a name="a1236"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'directDescendant'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1237"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1238"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'directDescendant'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1239"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1240"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1&nbsp;&gt;&nbsp;ele2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1241"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1242"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1243"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1244"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1245"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAnyDescendant">testAnyDescendant</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1246"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;direct&nbsp;Descendant</span></div></li>
<li><div class="src-line"><a name="a1247"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'anyDescendant'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1248"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1249"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'anyDescendant'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1250"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1251"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1&nbsp;&nbsp;.class'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1252"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1253"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1254"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1255"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1256"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAdjacent">testAdjacent</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1257"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;sibling</span></div></li>
<li><div class="src-line"><a name="a1258"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'adjacent'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1259"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1260"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'adjacent'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1261"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1262"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1&nbsp;+&nbsp;ele2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1263"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1264"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1265"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1266"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestSibling">testSibling</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1267"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;adjacent</span></div></li>
<li><div class="src-line"><a name="a1268"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'sibling'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1269"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1270"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'sibling'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1271"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1272"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1&nbsp;~&nbsp;ele2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1273"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1274"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1275"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1276"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAnotherSelector">testAnotherSelector</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1277"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;adjacent</span></div></li>
<li><div class="src-line"><a name="a1278"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'anotherSelector'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1279"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1280"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'anotherSelector'</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1281"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1282"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1&nbsp;,&nbsp;ele2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1283"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1284"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1285"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1286"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAttribute">testAttribute</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1287"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selectors&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a1288"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'element[attr]'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'attr'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1289"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr]'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'attr'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1290"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'element[attr]:class'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'attr'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1291"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1292"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$selectors&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$filter&nbsp;</span>=&gt;&nbsp;<span class="src-var">$expected</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1293"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attribute'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1294"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1295"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'attribute'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1296"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1297"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1298"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-var">$filter</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1299"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1300"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1301"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1302"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selectors&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a1303"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1304"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr^=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">beginsWith</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1305"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr$=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">endsWith</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1306"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr*=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">containsInString</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1307"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr~=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">containsWithSpace</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1308"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr|=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">containsWithHyphen</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1309"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1310"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;should&nbsp;act&nbsp;like&nbsp;[attr=&quot;value&quot;]</span></div></li>
<li><div class="src-line"><a name="a1311"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[|attr=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'value'</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1312"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1313"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;This&nbsp;behavior&nbsp;is&nbsp;displayed&nbsp;in&nbsp;the&nbsp;spec,&nbsp;but&nbsp;not&nbsp;accounted&nbsp;for&nbsp;in&nbsp;the&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1314"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;grammar:</span></div></li>
<li><div class="src-line"><a name="a1315"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[attr=value]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1316"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1317"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$selectors&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$filter&nbsp;</span>=&gt;&nbsp;<span class="src-var">$expected</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1318"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attribute'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1319"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1320"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'attribute'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1321"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1322"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1323"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-var">$filter</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1324"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1325"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1326"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1327"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1328"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAttributeNS">testAttributeNS</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1329"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selectors&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a1330"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[ns|attr=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'ns'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1331"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[*|attr^=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'*'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">beginsWith</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1332"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'*[*|attr|=&quot;value&quot;]'&nbsp;</span>=&gt;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attr'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'*'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'value'</span><span class="src-sym">,</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">containsWithHyphen</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1333"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1334"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1335"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$selectors&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$filter&nbsp;</span>=&gt;&nbsp;<span class="src-var">$expected</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1336"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock&nbsp;</span>=&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">getMock</span><span class="src-sym">(</span><span class="src-str">'TestCssEventHandler'</span><span class="src-sym">,&nbsp;</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'attributeNS'</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1337"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$mock</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">once</span><span class="src-sym">(</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a1338"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">method</span><span class="src-sym">(</span><span class="src-str">'attributeNS'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a1339"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">with</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">0</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">1</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">2</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">equalTo</span><span class="src-sym">(</span><span class="src-var">$expected</span><span class="src-sym">[</span><span class="src-num">3</span><span class="src-sym">]</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1340"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1341"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-var">$filter</span><span class="src-sym">,&nbsp;</span><span class="src-var">$mock</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1342"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1343"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1344"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1345"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1346"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;things&nbsp;that&nbsp;should&nbsp;break...</span></div></li>
<li><div class="src-line"><a name="a1347"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1348"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1349"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@expectedException</span><span class="src-doc">&nbsp;CssParseException</span></div></li>
<li><div class="src-line"><a name="a1350"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1351"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestIllegalCombinators1">testIllegalCombinators1</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1352"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1353"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1&nbsp;&gt;&nbsp;&gt;&nbsp;ele2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$handler</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1354"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1355"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1356"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1357"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1358"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@expectedException</span><span class="src-doc">&nbsp;CssParseException</span></div></li>
<li><div class="src-line"><a name="a1359"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1360"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestIllegalCombinators2">testIllegalCombinators2</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1361"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1362"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'ele1+&nbsp;,ele2'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$handler</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1363"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1364"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1365"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1366"></a>&nbsp;&nbsp;<span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1367"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*&nbsp;</span><span class="src-doc-tag">@expectedException</span><span class="src-doc">&nbsp;CssParseException</span></div></li>
<li><div class="src-line"><a name="a1368"></a><span class="src-doc">&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1369"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestIllegalID">testIllegalID</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1370"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1371"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-str">'##ID'</span><span class="src-sym">,&nbsp;</span><span class="src-var">$handler</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1372"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1373"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1374"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1375"></a>&nbsp;&nbsp;<span class="src-comm">//&nbsp;Test&nbsp;combinations</span></div></li>
<li><div class="src-line"><a name="a1376"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1377"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestElementNSClassAndAttribute">testElementNSClassAndAttribute</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1378"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1379"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$expect&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a1380"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementNS</span><span class="src-sym">,&nbsp;</span><span class="src-str">'element'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'ns'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1381"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementClass</span><span class="src-sym">,&nbsp;</span><span class="src-str">'class'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1382"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">attribute</span><span class="src-sym">,&nbsp;</span><span class="src-str">'name'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'value'</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1383"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1384"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector&nbsp;</span>=&nbsp;<span class="src-str">'ns|element.class[name=&quot;value&quot;]'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1385"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1386"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1387"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$expect</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1388"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-var">$selector</span><span class="src-sym">,&nbsp;</span><span class="src-var">$handler</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1389"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1390"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertTrue</span><span class="src-sym">(</span><span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">success</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1391"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1392"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Again,&nbsp;with&nbsp;spaces&nbsp;this&nbsp;time:</span></div></li>
<li><div class="src-line"><a name="a1393"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector&nbsp;</span>=&nbsp;<span class="src-str">'&nbsp;ns|element.&nbsp;class[&nbsp;&nbsp;name&nbsp;=&nbsp;&quot;value&quot;&nbsp;]'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1394"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1395"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1396"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$expect</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1397"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-var">$selector</span><span class="src-sym">,&nbsp;</span><span class="src-var">$handler</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1398"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1399"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1400"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$handler-&gt;dumpStack();</span></div></li>
<li><div class="src-line"><a name="a1401"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertTrue</span><span class="src-sym">(</span><span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">success</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1402"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1403"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1404"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/CssEventParserTests.html#methodtestAllCombo">testAllCombo</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1405"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1406"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$selector&nbsp;</span>=&nbsp;<span class="src-str">'*|ele1&nbsp;&gt;&nbsp;ele2.class1&nbsp;+&nbsp;ns1|ele3.class2[attr=simple]&nbsp;~&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1407"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.class2[attr2~=&quot;longer&nbsp;string&nbsp;of&nbsp;text.&quot;]:pseudoClass(value)&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1408"></a><span class="src-str">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.class3::pseudoElement'</span><span class="src-sym">;&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1409"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$expect&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line"><a name="a1410"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementNS</span><span class="src-sym">,&nbsp;</span><span class="src-str">'ele1'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'*'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1411"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">directDescendant</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1412"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">element</span><span class="src-sym">,&nbsp;</span><span class="src-str">'ele2'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1413"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementClass</span><span class="src-sym">,&nbsp;</span><span class="src-str">'class1'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1414"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">adjacent</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1415"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementNS</span><span class="src-sym">,&nbsp;</span><span class="src-str">'ele3'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'ns1'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1416"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementClass</span><span class="src-sym">,&nbsp;</span><span class="src-str">'class2'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1417"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">attribute</span><span class="src-sym">,&nbsp;</span><span class="src-str">'attr'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'simple'</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1418"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">sibling</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1419"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementClass</span><span class="src-sym">,&nbsp;</span><span class="src-str">'class2'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1420"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">attribute</span><span class="src-sym">,&nbsp;</span><span class="src-str">'attr2'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'longer&nbsp;string&nbsp;of&nbsp;text.'</span><span class="src-sym">,&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a></span><span class="src-sym">::</span><span class="src-id">containsWithSpace</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1421"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">pseudoClass</span><span class="src-sym">,&nbsp;</span><span class="src-str">'pseudoClass'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'value'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1422"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">anyDescendant</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1423"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementClass</span><span class="src-sym">,&nbsp;</span><span class="src-str">'class3'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1424"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">pseudoElement</span><span class="src-sym">,&nbsp;</span><span class="src-str">'pseudoElement'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><a name="a1425"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1426"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1427"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1428"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1429"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">expects</span><span class="src-sym">(</span><span class="src-var">$expect</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1430"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../QueryPath/CSSParser/CssParser.html">CssParser</a></span><span class="src-sym">(</span><span class="src-var">$selector</span><span class="src-sym">,&nbsp;</span><span class="src-var">$handler</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1431"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$parser</span><span class="src-sym">-&gt;</span><span class="src-id">parse</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1432"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1433"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//$handler-&gt;dumpStack();</span></div></li>
<li><div class="src-line"><a name="a1434"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1435"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><span class="src-id">assertTrue</span><span class="src-sym">(</span><span class="src-var">$handler</span><span class="src-sym">-&gt;</span><span class="src-id">success</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1436"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1437"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">/*</span></div></li>
<li><div class="src-line"><a name="a1438"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;//&nbsp;Again,&nbsp;with&nbsp;spaces&nbsp;this&nbsp;time:</span></div></li>
<li><div class="src-line"><a name="a1439"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$selector&nbsp;=&nbsp;'&nbsp;*|ele1&nbsp;&gt;&nbsp;ele2.&nbsp;class1&nbsp;+&nbsp;ns1|ele3.&nbsp;class2[&nbsp;attr=simple]&nbsp;~&nbsp;.class2[attr2&nbsp;~=&nbsp;&quot;longer&nbsp;string&nbsp;of&nbsp;text.&quot;]:pseudoClass(value)&nbsp;.class3::pseudoElement';&nbsp;&nbsp;&nbsp;&nbsp;</span></div></li>
<li><div class="src-line"><a name="a1440"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1441"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$handler&nbsp;=&nbsp;new&nbsp;TestCssEventHandler();</span></div></li>
<li><div class="src-line"><a name="a1442"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$handler-&gt;expects($expect);</span></div></li>
<li><div class="src-line"><a name="a1443"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$parser&nbsp;=&nbsp;new&nbsp;CssParser($selector,&nbsp;$handler);</span></div></li>
<li><div class="src-line"><a name="a1444"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$parser-&gt;parse();</span></div></li>
<li><div class="src-line"><a name="a1445"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1446"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$handler-&gt;dumpStack();</span></div></li>
<li><div class="src-line"><a name="a1447"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;assertTrue($handler-&gt;success());</span></div></li>
<li><div class="src-line"><a name="a1448"></a><span class="src-comm">&nbsp;&nbsp;&nbsp;&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1449"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1450"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1451"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1452"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1453"></a><span class="src-doc">&nbsp;*&nbsp;Testing&nbsp;harness&nbsp;for&nbsp;the&nbsp;CssEventHandler.</span></div></li>
<li><div class="src-line"><a name="a1454"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1455"></a><span class="src-key">class&nbsp;</span><a href="../Tests/TestCssEventHandler.html">TestCssEventHandler</a>&nbsp;<span class="src-key">implements&nbsp;</span><a href="../QueryPath/CSSParser/CssEventHandler.html">CssEventHandler</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1456"></a>&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../Tests/TestCssEventHandler.html#var$stack">$stack</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1457"></a>&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../Tests/TestCssEventHandler.html#var$expect">$expect</a>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1458"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1459"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1460"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a>&nbsp;=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1461"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1462"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1463"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodgetStack">getStack</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1464"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1465"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1466"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1467"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methoddumpStack">dumpStack</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1468"></a>&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;<span class="src-str">&quot;\nExpected:\n&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1469"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$format&nbsp;</span>=&nbsp;<span class="src-str">&quot;Element&nbsp;%d:&nbsp;%s\n&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1470"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$expect">expect</a>&nbsp;<span class="src-key">as&nbsp;</span><span class="src-var">$item</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1471"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/printf">printf</a><span class="src-sym">(</span><span class="src-var">$format</span><span class="src-sym">,&nbsp;</span><span class="src-var">$item</span><span class="src-sym">-&gt;</span><span class="src-id">eventType</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">,&nbsp;</span><span class="src-var">$item</span><span class="src-sym">-&gt;</span><span class="src-id">params</span><span class="src-sym">(</span><span class="src-sym">)))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1472"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1473"></a>&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1474"></a>&nbsp;&nbsp;&nbsp;&nbsp;print&nbsp;<span class="src-str">&quot;Got:\n&quot;</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1475"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">foreach</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a>&nbsp;<span class="src-key">as&nbsp;</span><span class="src-var">$item</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1476"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/printf">printf</a><span class="src-sym">(</span><span class="src-var">$format</span><span class="src-sym">,&nbsp;</span><span class="src-var">$item</span><span class="src-sym">-&gt;</span><span class="src-id">eventType</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">,&nbsp;</span><a href="http://www.php.net/implode">implode</a><span class="src-sym">(</span><span class="src-str">','</span><span class="src-sym">,&nbsp;</span><span class="src-var">$item</span><span class="src-sym">-&gt;</span><span class="src-id">params</span><span class="src-sym">(</span><span class="src-sym">)))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1477"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1478"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1479"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1480"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodexpects">expects</a><span class="src-sym">(</span><span class="src-var">$stack</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1481"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$expect">expect</a>&nbsp;=&nbsp;<span class="src-var">$stack</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1482"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1483"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1484"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodsuccess">success</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1485"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-sym">(</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$expect">expect</a>&nbsp;==&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1486"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1487"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1488"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodelementID">elementID</a><span class="src-sym">(</span><span class="src-var">$id</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1489"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementID</span><span class="src-sym">,&nbsp;</span><span class="src-var">$id</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1490"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1491"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodelement">element</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1492"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">element</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1493"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1494"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodelementNS">elementNS</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$namespace&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1495"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementNS</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$namespace</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1496"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1497"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodanyElement">anyElement</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1498"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">anyElement</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1499"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1500"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodanyElementInNS">anyElementInNS</a><span class="src-sym">(</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1501"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">anyElementInNS</span><span class="src-sym">,&nbsp;</span><span class="src-var">$ns</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1502"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1503"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodelementClass">elementClass</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1504"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">elementClass</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1505"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1506"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodattribute">attribute</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$operation&nbsp;</span>=&nbsp;<span class="src-id">CssEventHandler</span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1507"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">attribute</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$operation</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1508"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1509"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodattributeNS">attributeNS</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$ns</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">,&nbsp;</span><span class="src-var">$operation&nbsp;</span>=&nbsp;<span class="src-id">CssEventHandler</span><span class="src-sym">::</span><span class="src-id">isExactly</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1510"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">attributeNS</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$ns</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">,&nbsp;</span><span class="src-var">$operation</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1511"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1512"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodpseudoClass">pseudoClass</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value&nbsp;</span>=&nbsp;<span class="src-id">NULL</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1513"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">pseudoClass</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">,&nbsp;</span><span class="src-var">$value</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1514"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1515"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodpseudoElement">pseudoElement</a><span class="src-sym">(</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1516"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">pseudoElement</span><span class="src-sym">,&nbsp;</span><span class="src-var">$name</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1517"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1518"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methoddirectDescendant">directDescendant</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1519"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">directDescendant</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1520"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1521"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodanyDescendant">anyDescendant</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1522"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">anyDescendant</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1523"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1524"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodadjacent">adjacent</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1525"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">adjacent</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1526"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1527"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodanotherSelector">anotherSelector</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1528"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">anotherSelector</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1529"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1530"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestCssEventHandler.html#methodsibling">sibling</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1531"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestCssEventHandler.html#var$stack">stack</a><span class="src-sym">[</span><span class="src-sym">]&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">(</span><span class="src-id"><a href="../Tests/TestEvent.html">TestEvent</a></span><span class="src-sym">::</span><span class="src-id">sibling</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1532"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1533"></a><span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1534"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a1535"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a1536"></a><span class="src-doc">&nbsp;*&nbsp;Simple&nbsp;utility&nbsp;object&nbsp;for&nbsp;use&nbsp;with&nbsp;the&nbsp;TestCssEventHandler.</span></div></li>
<li><div class="src-line"><a name="a1537"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a1538"></a><span class="src-key">class&nbsp;</span><a href="../Tests/TestEvent.html">TestEvent</a>&nbsp;<span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1539"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constelementID">elementID</a>&nbsp;=&nbsp;<span class="src-num">0</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1540"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constelement">element</a>&nbsp;=&nbsp;<span class="src-num">1</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1541"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constelementNS">elementNS</a>&nbsp;=&nbsp;<span class="src-num">2</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1542"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constanyElement">anyElement</a>&nbsp;=&nbsp;<span class="src-num">3</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1543"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constelementClass">elementClass</a>&nbsp;=&nbsp;<span class="src-num">4</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1544"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constattribute">attribute</a>&nbsp;=&nbsp;<span class="src-num">5</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1545"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constattributeNS">attributeNS</a>&nbsp;=&nbsp;<span class="src-num">6</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1546"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constpseudoClass">pseudoClass</a>&nbsp;=&nbsp;<span class="src-num">7</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1547"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constpseudoElement">pseudoElement</a>&nbsp;=&nbsp;<span class="src-num">8</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1548"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constdirectDescendant">directDescendant</a>&nbsp;=&nbsp;<span class="src-num">9</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1549"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constadjacent">adjacent</a>&nbsp;=&nbsp;<span class="src-num">10</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1550"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constanotherSelector">anotherSelector</a>&nbsp;=&nbsp;<span class="src-num">11</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1551"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constsibling">sibling</a>&nbsp;=&nbsp;<span class="src-num">12</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1552"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constanyElementInNS">anyElementInNS</a>&nbsp;=&nbsp;<span class="src-num">13</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1553"></a>&nbsp;&nbsp;<span class="src-key">const&nbsp;</span><a href="../Tests/TestEvent.html#constanyDescendant">anyDescendant</a>&nbsp;=&nbsp;<span class="src-num">14</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1554"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1555"></a>&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../Tests/TestEvent.html#var$type">$type</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1556"></a>&nbsp;&nbsp;<span class="src-key">var&nbsp;</span><a href="../Tests/TestEvent.html#var$params">$params</a>&nbsp;=&nbsp;<span class="src-id">NULL</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1557"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1558"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestEvent.html#method__construct">__construct</a><span class="src-sym">(</span><span class="src-var">$event_type</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1559"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestEvent.html#var$type">type</a>&nbsp;=&nbsp;<span class="src-var">$event_type</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1560"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$args&nbsp;</span>=&nbsp;<a href="http://www.php.net/func_get_args">func_get_args</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1561"></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.php.net/array_shift">array_shift</a><span class="src-sym">(</span><span class="src-var">$args</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1562"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestEvent.html#var$params">params</a>&nbsp;=&nbsp;<span class="src-var">$args</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1563"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1564"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1565"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestEvent.html#methodeventType">eventType</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1566"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestEvent.html#var$type">type</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1567"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1568"></a>&nbsp;&nbsp;</div></li>
<li><div class="src-line"><a name="a1569"></a>&nbsp;&nbsp;<span class="src-key">public&nbsp;</span><span class="src-key">function&nbsp;</span><a href="../Tests/TestEvent.html#methodparams">params</a><span class="src-sym">(</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line"><a name="a1570"></a>&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-key">return&nbsp;</span><span class="src-var">$this</span><span class="src-sym">-&gt;</span><a href="../Tests/TestEvent.html#var$params">params</a><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a1571"></a>&nbsp;&nbsp;<span class="src-sym">}</span></div></li>
<li><div class="src-line"><a name="a1572"></a><span class="src-sym">}</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:04 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>